package com.hzcx.app.simplechat.ui.chat.presenter;

import android.content.Context;

import com.hzcx.app.simplechat.api.BaseObserver;
import com.hzcx.app.simplechat.base.BasePresenter;
import com.hzcx.app.simplechat.model.GroupModel;
import com.hzcx.app.simplechat.ui.chat.bean.GroupSearchBean;
import com.hzcx.app.simplechat.ui.chat.contract.GroupSearchContract;

import java.util.List;

public class GroupSearchPresenter extends BasePresenter<GroupSearchContract.View> implements GroupSearchContract.Presenter {

    @Override
    public void searchGroupList(Context context, String groupID) {
        GroupModel.searchGroupList(context, groupID,"", new BaseObserver<List<GroupSearchBean>>() {
            @Override
            protected void onSuccess(List<GroupSearchBean> data) {
                mView.searchGroupListResult(data);
            }

            @Override
            public void onFailure(Throwable e, String errorMsg) {
                super.onFailure(e, errorMsg);
                mView.onFail();
            }
        });
    }
}